gtknotebook: avoid tab dnd from content
authorCarlos Soriano <csoriano@gnome.org>
Mon, 2 May 2016 08:19:12 +0000 (10:19 +0200)
committerCarlos Soriano <csoriano@gnome.org>
Mon, 2 May 2016 11:17:48 +0000 (13:17 +0200)
commitddb0740a212a077793f77df7b76f4fbd25af707e
treef03803abb67f16d5dd68a477276f8a21150ec22a
parentbab628beb23f74e8035878e0c4cc54309b2a7995
gtknotebook: avoid tab dnd from content

Before commit 6c1bee2377eba8 we were setting an attribute of GtkNotebook
to track the pressed button if the pressed button happened on the
tab itself.
Later in the motion handling code we were checking whether the private
pressed button attribute was set or not in order to handle a tab dnd
or not.

In commit 6c1bee2377eba8 the code changed and set the pressed button
variable unconditionally, which means, a motion event from within the
tab content triggered a tab reordering.

This happened only if the children hierarchy have a widget that bubbles
up both button press event, which sets the private pressed button
attribute; and motion events, which started the tab dnd checking the
private pressed button attribute.
A widget that experienced the regression was GtkListBox.

In order to fix it, set the button pressed variable only when it press
the tab itself, not the content.

https://bugzilla.gnome.org/show_bug.cgi?id=764395
gtk/gtknotebook.c